<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>商品列表</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

    <!-- jquery：用户异步发出请求（注：@为thymeleaf的静态资源引入符） -->
    <script type="text/javascript" th:src="@{/js/jquery.min.js}"></script>
    <!-- bootstrap：页面展示 -->
    <link rel="stylesheet" type="text/css" th:href="@{/bootstrap/css/bootstrap.min.css}"/>
    <script type="text/javascript" th:src="@{/bootstrap/js/bootstrap.min.js}"></script>
    <!-- jquery-validator：表单校验 -->
    <script type="text/javascript" th:src="@{/jquery-validation/jquery.validate.min.js}"></script>
    <script type="text/javascript" th:src="@{/jquery-validation/localization/messages_zh.min.js}"></script>
    <!-- layer：弹出窗-->
    <script type="text/javascript" th:src="@{/layer/layer.js}"></script>
    <!-- md5.js：计算MD的js脚本-->
    <script type="text/javascript" th:src="@{/js/md5.min.js}"></script>
    <!-- common.js：js通用回调函数 -->
    <script type="text/javascript" th:src="@{/js/common.js}"></script>

</head>
<body>


<div class="panel panel-default">
    <div class="panel-heading"><h1>秒杀商品列表</h1></div>
    <table class="table" id="goodslist">
        <tr>
            <td><b style="font-size: medium">商品名称</b></td>
            <td><b style="font-size: medium">商品图片</b></td>
            <td><b style="font-size: medium">商品原价</b></td>
            <td style="color: crimson"><b style="font-size: medium">秒杀价</b></td>
            <td><b style="font-size: medium">库存数量</b></td>
            <td><b style="font-size: medium">详情</b></td>
        </tr>

        <tr th:each="goods,goodsStat : ${goodsList}">
            <td th:text="${goods.goodsName}"></td>
            <td><img th:src="@{${goods.goodsImg}}" width="100" height="100"/></td>
            <td th:text="${goods.goodsPrice}"></td>
            <td th:text="${goods.seckillPrice}" style="color: crimson"></td>
            <td th:text="${goods.stockCount}"></td>
            <!--<td><a th:href="'/goods/to_detail/'+${goods.id}">详情</a></td>-->
            <!--静态化详情页面-->
            <!--<td><a th:href="'/goods_detail.htm?goodsId='+${goods.id}">详情</a></td>-->
            <td>
                <a th:href="'/goods_detail.htm?goodsId='+${goods.id}">
                    <button class="btn btn-primary" type="button" id="buyButton">详情</button>
                </a>
            </td>
        </tr>
    </table>
</div>

</body>

</html>